import 'package:flutter/cupertino.dart';
import 'package:oli/page/main.dart';
import 'package:oli/page/order/no_contronc/main.dart';

class AppRouter {
  // 路由列表
  static final Map<String, WidgetBuilder> routes = {
    MainPage.routeName: (ctx) => MainPage(),
    NoCon.routeName: (ctx) => NoCon(),
  };

  // 初始路由
  static final initRoute = MainPage.routeName;

  // 生产可拦截路由
  static final RouteFactory generateRoute = (settings) {
    // if (settings.name == MainPage.name) {
    //   return MaterialPageRoute(
    //     builder: (ctx) {
    //       return MainPage(settings.arguments);
    //     }
    //   );
    // }

    return null;
  };

  // 404 路由
  static final RouteFactory unknownRoute = (settings) {
    // if (settings.name == MainPage.name) {
    //   return MaterialPageRoute(
    //     builder: (ctx) {
    //       return MainPage(settings.arguments);
    //     }
    //   );
    // }

    return null;
  };
}